public enum WeekDay {
    //枚举类，枚举常量，枚举对象
    //枚举常量是一个对象，枚举常量是一个类的对象
    //枚举常量是一个类的对象，枚举常量是一个类的对象，枚举常量是一个类的对象
    //默认的枚举常量是无参构造方法创建的
    MONDAY("周一",0),
    TUESDAY("周二",1),
    WEDNESDAY("周二",1),
    THURSDAY("周二",1),
    FRIDAY("周二",1),
    SATURDAY("周二",1),
    SUNDAY("周二",1);

   public static void main(String[] args) {
       System.out.println(WeekDay.MONDAY.name());//名称
       System.out.println(WeekDay.MONDAY.ordinal());//索引，从0开始
       System.out.println(WeekDay.MONDAY.toString());//字符串
       System.out.println(WeekDay.MONDAY.compareTo(WeekDay.TUESDAY));//比较
       System.out.println(WeekDay.MONDAY.equals(WeekDay.TUESDAY));//比较
       for (WeekDay value : WeekDay.MONDAY.values()) {
           System.out.println(value);
       }
       System.out.println(WeekDay.valueOf("MONDAY"));//根据名称获取枚举对象
   }

     private String description;
     private int index;

    WeekDay() {
    }

    WeekDay(String description, int index) {
        this.description = description;
        this.index = index;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }
}
